home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VGADOC4B.ZIP / PCI.TXT < prev    next >
Text File  |  1995-09-29  |  21KB  |  483 lines

  1.  
  2. There are two configuration methods, depending on the PCI chipsets used:
  3.  
  4. Configuration Type 1:
  5.  
  6. CF8h D(R/W):
  7. bit   0-7  Index into the configuration space to read/write at CFCh
  8.     11-15  Card ID (0 - 31)
  9.     16-19  PCI Bus ID (0 - 15)
  10.        31  Set to enable the PCI bus configuration space
  11.  
  12. CFCh D(R/W):
  13. bit  0-31  The index register identified by the PCI bus/card ID/Index in CF8h
  14.            can be accessed here.
  15.  
  16.  
  17. Configuration Type 2:
  18.  
  19. CF8h (R/W):
  20. bit   7  Set to select the PCI configuration space
  21.  
  22. CFAh (R/W):
  23. bit 0-?  Bus select ?
  24.  
  25.  
  26. Finding the PCI devices:
  27.  
  28.   PCItype:=0;
  29.   outp($CF8,0);
  30.   outp($CFA,0);
  31.   if (inp($CF8)=0) and (inp($CFA)=0) then PCItype:=2
  32.   else begin
  33.     tmp=inpl($CF8);
  34.     outpl($CF8,$80000000);
  35.     if inpl($CF8)=$80000000 then PCItype:=1;
  36.     outpl($CF8,tmp);
  37.   end;
  38.   case PCItype of
  39.     1:begin   {PCI type 1}
  40.         for i:=0 to 511 do
  41.         begin
  42.           outpl($CF8,$80000000+i*longint(2048));
  43.           tmp:=inpl($CFC);
  44.           if ((tmp and $FFFF)<>$FFFF) and ((tmp shr 16)<>$FFFF) then
  45.             _PCI Device: Vendor: (l and $FFFF)  Device: (l shr 16)_
  46.         end;
  47.       end;
  48.     2:begin   {PCI type 2}
  49.         outp($CF8,$80);
  50.         outp($CFA,0);   {Bus select?}
  51.         for i:=0 to 15 do
  52.         begin
  53.           tmp:=inpl(i*256 +$C000);
  54.           if ((tmp and $FFFF)<>$FFFF) and ((tmp shr 16)<>$FFFF) then
  55.             _PCI Device: Vendor: (l and $FFFF)  Device: (l shr 16)_
  56.         end;
  57.         outp($CF8,0);
  58.       end;
  59.   end;
  60.  
  61.  
  62. The PCI BIOS interface requires a 386 or better CPU.
  63.  
  64.  
  65. --------X-1AB001-----------------------------
  66. INT 1A - ? PCI ? - INSTALLATION CHECK
  67.         AX = B001h
  68. Return: CF clear if installed
  69.             DX = 4350h ('CP')
  70.             CX = 2049h (' I')
  71. --------X-1AB002-----------------------------
  72. INT 1A - ? PCI ? - FIND PCI DEVICE
  73.         AX = B002h
  74.         CX = device ID
  75.         DX = vendor ID
  76.         SI = device index (0-n)
  77. Return: CF clear if successful
  78.                 BH = bus number
  79.                 BL = device/function number (bits 7-3 device, bits 2-0 func)
  80. --------X-1AB00A-----------------------------
  81. INT 1A - ? PCI ? - READ CONFIGURATION DWORD
  82.         AX = B00Ah
  83.         BH = bus number
  84.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  85.         DI = register number (0000h-00FFh)
  86. Return: CF clear if successful
  87.           CX = Low 16 bit of the DWORD
  88.           DX = High 16 bit of the DWORD
  89.  
  90. --------X-1AB101-----------------------------
  91. INT 1A - Intel PCI BIOS v2.0c - INSTALLATION CHECK
  92.         AX = B101h
  93. Return: AH = 00h if installed
  94.             CF clear
  95.             EDX = 20494350h (' ICP')
  96.             EDI = physical address of protected-mode entry point (see #0528)
  97.             AL = PCI hardware characteristics (see #0527)
  98.             BH = PCI interface level major version (BCD)
  99.             BL = PCI interface level minor version (BCD)
  100.             CL = number of last PCI bus in system
  101.         EAX, EBX, ECX, and EDX may be modified
  102.         all other flags (except IF) may be modified
  103. Note:   this function may require up to 1024 byte of stack; it will not enable
  104.         interrupts if they were disabled before making the call
  105.  
  106. Bitfields for PCI hardware characteristics:
  107. Bit(s)  Description (Table 0527)
  108.  0      configuration space access mechanism 1 supported
  109.  1      configuration space access mechanism 2 supported
  110.  2-3    reserved
  111.  4      Special Cycle generation mechanism 1 supported
  112.  5      Special Cycle generation mechanism 2 supported
  113.  6-7    reserved
  114.  
  115. (Table 0528)
  116. Call protected-mode entry point with:
  117.         registers as for real/V86-mode INT call
  118.         CS = ring 0 descriptor with access to full address space
  119. Return: as for real/V86-mode call
  120. --------X-1AB102-----------------------------
  121. INT 1A - Intel PCI BIOS v2.0c - FIND PCI DEVICE
  122.         AX = B102h
  123.         CX = device ID
  124.         DX = vendor ID
  125.         SI = device index (0-n)
  126. Return: CF clear if successful
  127.         CF set on error
  128.         AH = status
  129.             00h successful
  130.                 BH = bus number
  131.                 BL = device/function number (bits 7-3 device, bits 2-0 func)
  132.             83h bad vendor ID
  133.             86h device not found
  134.         EAX, EBX, ECX, and EDX may be modified
  135.         all other flags (except IF) may be modified
  136. Notes:  this function may require up to 1024 byte of stack; it will not enable
  137.         interrupts if they were disabled before making the call device ID FFFFh
  138.         may be reserved as a wildcard in future implementations the meanings of
  139.         BL and BH on return were exchanged between the initial drafts of the
  140.         specification and final implementation all devices sharing a single
  141.         vendor ID and device ID may be enumerated by incrementing SI from 0
  142.         until error 86h is returned
  143. --------X-1AB103-----------------------------
  144. INT 1A - Intel PCI BIOS v2.0c - FIND PCI CLASS CODE
  145.         AX = B103h
  146.         ECX = class code (bits 23-0)
  147.         SI = device index (0-n)
  148. Return: CF clear if successful
  149.         CF set on error
  150.         AH = status
  151.             00h successful
  152.                 BH = bus number
  153.                 BL = device/function number (bits 7-3 device, bits 2-0 func)
  154.             86h device not found
  155.         EAX, EBX, ECX, and EDX may be modified
  156.         all other flags (except IF) may be modified
  157. Notes:  this function may require up to 1024 byte of stack; it will not enable
  158.         interrupts if they were disabled before making the call the meanings
  159.         of BL and BH on return were exchanged between the initial drafts of
  160.         the specification and final implementation all devices sharing the
  161.         same Class Code may be enumerated by incrementing SI from 0 until
  162.         error 86h is returned
  163. --------X-1AB106-----------------------------
  164. INT 1A - Intel PCI BIOS v2.0c - PCI BUS-SPECIFIC OPERATIONS
  165.         AX = B106h
  166.         BL = bus number
  167.         EDX = Special Cycle data
  168. Return: CF clear if successful
  169.         CF set on error
  170.         AH = status
  171.             00h successful
  172.             81h unsupported function
  173.         EAX, EBX, ECX, and EDX may be modified
  174.         all other flags (except IF) may be modified
  175. Note:   this function may require up to 1024 byte of stack; it will not enable
  176.         interrupts if they were disabled before making the call
  177. --------X-1AB108-----------------------------
  178. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION BYTE
  179.         AX = B108h
  180.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  181.         BH = bus number
  182.         DI = register number (0000h-00FFh)
  183. Return: CF clear if successful
  184.              CL = byte read
  185.         CF set on error
  186.         AH = status
  187.              00h successful
  188.              87h bad register number
  189.         EAX, EBX, ECX, and EDX may be modified
  190.         all other flags (except IF) may be modified
  191. Notes:  this function may require up to 1024 byte of stack; it will not enable
  192.         interrupts if they were disabled before making the call the meanings
  193.         of BL and BH on return were exchanged between the initial drafts of
  194.         the specification and final implementation
  195. --------X-1AB109-----------------------------
  196. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION WORD
  197.         AX = B109h
  198.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  199.         BH = bus number
  200.         DI = register number (0000h-00FFh)
  201. Return: CF clear if successful
  202.             CX = word read
  203.         CF set on error
  204.         AH = status
  205.             00h successful
  206.             87h bad register number
  207.         EAX, EBX, ECX, and EDX may be modified
  208.         all other flags (except IF) may be modified
  209. Notes:  this function may require up to 1024 byte of stack; it will not enable
  210.         interrupts if they were disabled before making the call the meanings
  211.         of BL and BH on return were exchanged between the initial drafts of
  212.         the specification and final implementation
  213. --------X-1AB10A-----------------------------
  214. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION DWORD
  215.         AX = B10Ah
  216.         BH = bus number
  217.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  218.         DI = register number (0000h-00FFh)
  219. Return: CF clear if successful
  220.             ECX = dword read
  221.         CF set on error
  222.         AH = status
  223.             00h successful
  224.             87h bad register number
  225.         EAX, EBX, ECX, and EDX may be modified
  226.         all other flags (except IF) may be modified
  227. Notes: this function may require up to 1024 byte of stack; it will not enable
  228.        interrupts if they were disabled before making the call the meanings of
  229.        BL and BH on return were exchanged between the initial drafts of the
  230.        specification and final implementation
  231. --------X-1AB10B-----------------------------
  232. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION BYTE
  233.         AX = B10Bh
  234.         BH = bus number
  235.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  236.         DI = register number (0000h-00FFh)
  237.         CL = byte to write
  238. Return: CF clear if successful
  239.         CF set on error
  240.         AH = status
  241.             00h successful
  242.             87h bad register number
  243.         EAX, EBX, ECX, and EDX may be modified
  244.         all other flags (except IF) may be modified
  245. Notes:  this function may require up to 1024 byte of stack; it will not enable
  246.         interrupts if they were disabled before making the call the meanings
  247.         of BL and BH on return were exchanged between the initial drafts of
  248.         the specification and final implementation
  249. --------X-1AB10C-----------------------------
  250. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION WORD
  251.         AX = B10Ch
  252.         BH = bus number
  253.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  254.         DI = register number (multiple of 2 less than 0100h)
  255.         CX = word to write
  256. Return: CF clear if successful
  257.         CF set on error
  258.         AH = status
  259.             00h successful
  260.             87h bad register number
  261.         EAX, EBX, ECX, and EDX may be modified
  262.         all other flags (except IF) may be modified
  263. Notes:  this function may require up to 1024 byte of stack; it will not enable
  264.         interrupts if they were disabled before making the call the meanings
  265.         of BL and BH on return were exchanged between the initial drafts of
  266.         the specification and final implementation
  267. --------X-1AB10D-----------------------------
  268. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION DWORD
  269.         AX = B10Dh
  270.         BH = bus number
  271.         BL = device/function number (bits 7-3 device, bits 2-0 function)
  272.         DI = register number (multiple of 4 less than 0100h)
  273.         ECX = dword to write
  274. Return: CF clear if successful
  275.         CF set on error
  276.         AH = status
  277.             00h successful
  278.             87h bad register number
  279.         EAX, EBX, ECX, and EDX may be modified
  280.         all other flags (except IF) may be modified
  281. Notes:  this function may require up to 1024 byte of stack; it will not enable
  282.         interrupts if they were disabled before making the call the meanings
  283.         of BL and BH on return were exchanged between the initial drafts of
  284.         the specification and final implementation
  285. --------X-1AB181-----------------------------
  286. INT 1A - Intel PCI BIOS v2.0c - INSTALLATION CHECK (32-bit)
  287.         AX = B181h
  288. Return: as for AX=B101h
  289. --------X-1AB182-----------------------------
  290. INT 1A - Intel PCI BIOS v2.0c - FIND PCI DEVICE (32-bit)
  291.         AX = B182h
  292.         CX = device ID
  293.         DX = vendor ID
  294.         SI = device index (0-n)
  295. Return: as for AX=B102h
  296. --------X-1AB183-----------------------------
  297. INT 1A - Intel PCI BIOS v2.0c - FIND PCI CLASS CODE (32-bit)
  298.         AX = B183h
  299.         ECX = class code (bits 23-0)
  300.         SI = device index (0-n)
  301. Return: as for AX=B103h
  302. --------X-1AB186-----------------------------
  303. INT 1A - Intel PCI BIOS v2.0c - PCI BUS-SPECIFIC OPERATIONS (32-bit)
  304.         AX = B186h
  305.         BL = bus number
  306.         EDX = Special Cycle data
  307. Return: as for AX=B106h
  308. --------X-1AB188-----------------------------
  309. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION BYTE (32-bit)
  310.         AX = B188h
  311.         BL = bus number
  312.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  313.         DI = register number (0000h-00FFh)
  314. Return: as for AX=B108h
  315. --------X-1AB189-----------------------------
  316. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION WORD (32-bit)
  317.         AX = B189h
  318.         BL = bus number
  319.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  320.         DI = register number (0000h-00FFh)
  321. Return: as for AX=B109h
  322. --------X-1AB18A-----------------------------
  323. INT 1A - Intel PCI BIOS v2.0c - READ CONFIGURATION DWORD (32-bit)
  324.         AX = B18Ah
  325.         BL = bus number
  326.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  327.         DI = register number (0000h-00FFh)
  328. Return: as for AX=B10Ah
  329. --------X-1AB18B-----------------------------
  330. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION BYTE (32-bit)
  331.         AX = B18Bh
  332.         BL = bus number
  333.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  334.         DI = register number (0000h-00FFh)
  335.         CL = byte to write
  336. Return: as for AX=B10Bh
  337. --------X-1AB18C-----------------------------
  338. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION WORD (32-bit)
  339.         AX = B18Ch
  340.         BL = bus number
  341.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  342.         DI = register number (multiple of 2 less than 0100h)
  343.         CX = word to write
  344. Return: as for AX=B10Ch
  345. --------X-1AB18D-----------------------------
  346. INT 1A - Intel PCI BIOS v2.0c - WRITE CONFIGURATION DWORD (32-bit)
  347.         AX = B18Dh
  348.         BL = bus number
  349.         BH = device/function number (bits 7-3 device, bits 2-0 function)
  350.         DI = register number (multiple of 4 less than 0100h)
  351.         ECX = dword to write
  352. Return: as for AX=B10Dh
  353.  
  354.  
  355.  
  356. The PCI configuration space consists of 256bytes per device, the first 64
  357. bytes are laid out as follows, though an adapter may not implement all fields.
  358.  
  359. Offset  Size    Description:
  360.   00h   WORD    Vendor ID. FFFFh is reserved.
  361.   02h   WORD    Device ID. FFFFh is reserved.
  362.   04h   WORD    System Bus Command
  363.                 Bit 0  I/O Space. If set the device is allowed to respond to
  364.                        I/O requests, if clear the device does not respond.
  365.                     1  Memory Space. If set the device is allowed to respond
  366.                        to Meory requests, if clear the device does not
  367.                        respond.
  368.                     3  Special Cycles. If set the device is allowed to monitor
  369.                        special cycles.
  370.                     5  VGA Palette Snoop. If set special snooping behavior is
  371.                        enabled. The device must not respond to DAC writes.
  372.                        If clear palette accesses are treated normally.
  373.                     6  Parity Error. If set the device responds to parity
  374.                        errors, if clear it ignores them. The device must
  375.                        generate parity even if this bit is clear.
  376.                     7  Wait Cycle Control. If set data/address stepping is
  377.                        enabled, disabled if clear.
  378.                     8  System Error Driver. If set the error driver reports
  379.                        parity errors, if clear the system error driver is
  380.                        disconnected.
  381.                     9  Back-to-Back Cycle. If set the device supports back-to
  382.                         -back cycles.
  383.   06h   WORD    System Bus Status
  384.                 Bit 7  (R) Fast back-to-back. If set the device is capable of
  385.                        fast back-to-back cycles, if clear it is not.
  386.                     8  Bus Master. Only implemented by Bus Masters
  387.                  9-10  (R) Device Select Timing. DEVSEL# timing. 0: fast,
  388.                          1: medium, 2: slow
  389.                    11  Device Target-abort. Set whenever the device (as target)
  390.                        issues a Target Abort. Write 1 to reset.
  391.                    12  Received Target-abort. Set whenever the device (as
  392.                        Master) receives a Target Abort. Write 1 to reset.
  393.                    13  Master Abort Status. Set whenever the device issues a
  394.                        Master Abort. Write 1 to reset.
  395.   08h   BYTE    Revision Code.
  396.   09h   BYTE    Programming Interface.
  397.   0Ah   WORD    Class. 300h for VGA devices, 1 for 8514/A devices
  398.   0Ch   BYTE    Cache line size
  399.   0Dh   BYTE    Latency timer.
  400.                 Bit 0-2  (R)
  401.                     3-7
  402.   0Eh   BYTE    Header type
  403.                 Bit 0-6  Current offset for configuration register ?
  404.                       7  Multifunction Device?
  405.   0Fh   BYTE    Bist?
  406.   10h   DWORD   Base0 - Defines a Memory or I/O region used by the device
  407.                 Bit  0  (R) Memory or I/O. Set if the region is in I/O space,
  408.                             clear if it is in Memory space.
  409.                    1-2  (R) Locatable Area. 0: Anywhere in 32bit address space
  410.                              1: Below 1MB, 2: anywhere in 64bit address space
  411.                      3  (R) Pre-fetchable. Set if memory is cacheable, clear
  412.                             if not.
  413.                    4-7  (R) Address space size
  414.                   8-31  Memory Base. Upper 24bit of the base address.
  415.   14h   DWORD   Base1 - Similar to Base0
  416.   18h   DWORD   Base2 - Similar to Base0
  417.   1Ch   DWORD   Base3 - Similar to Base0
  418.   20h   DWORD   Base4 - Similar to Base0
  419.   24h   DWORD   Base5 - Similar to Base0
  420.   28h   DWORD   Reserved
  421.   2Ch   DWORD   Reserved
  422.   30h   DWORD   ROM Base - Defines the location & size of the BIOS ROM
  423.                 Bit   0  ROM BIOS Decode. Set to enable BIOS access
  424.                   11-14  (R) ROM BIOS Min Size.
  425.                            0:  32K ROM (bits 15-17 R/W)
  426.                            1:  64K ROM (bits 15 RO, 16-17 R/W)
  427.                            2: 128K ROM (bits 15-16 RO, 17 R/W)
  428.                            3: 256K ROM (bits 15-17 RO)
  429.                   15-31  BIOS Base Address. Upper 14-17 bits of the BIOS
  430.                          location. Depending on the BIOS size in bits 11-14
  431.                          the lowest 1/2/3 bits may be forced to 0.
  432.   34h   DWORD   Reserved
  433.   38h   DWORD   Reserved
  434.   3Ch   BYTE    Interrupt Line
  435.                 Used for Interrupt Line info during initialisation
  436.   3Dh   BYTE    Interrupt Pin
  437.                 Identifies the interrupt lines used
  438.   3Eh   BYTE    Minimum Grant
  439.                 Specifies the longest burst allowed
  440.   3Fh   BYTE    Max Lat
  441.                 Indicates how often the device geta access to the PCI bus.
  442.  
  443.  
  444. Known Vendor/Device ID combinations:
  445. Vendor:   Device:     Card:
  446.  0E11h     3032h      Compaq QVision 1280P
  447.  1000h                NCR
  448.  1002h     4158h      ATI Mach32 (68800-AX)
  449.            4758h      ATI Mach64 (88800-GX)
  450.  1005h     2301h      Avance Logic ALG2301
  451.            2302h      Avance Logic ALG2302
  452.            2364h      Avance Logic ALG2364
  453.  100Ch     3202h      Tseng ET4000/W32p revA
  454.            3207h      Tseng ET4000/W32p revD
  455.  100Eh     9001h      Weitek Viper/PCI
  456.            9100h      Weitek Viper Pro/SE
  457.  1011h                Digital
  458.  1013h     00A0h      Cirrus Logic CL-GD5430
  459.            00A8h      Cirrus Logic CL-GD5434
  460.            1200h      Cirrus Logic CL-GD7542 (Nordic)
  461.            1202h      Cirrus Logic CL-GD7543 (Viking)
  462.            1204h      Cirrus Logic CL-GD7541 (Nordic Light)
  463.  101Ah                NCR
  464.  1023h     9420h      Trident TGUI9420DGi
  465.            9430h      Trident TGUI9430
  466.  1025h     1435h      Acer Labs M1435 (huh maybe M3145??)
  467.  102Bh     0518h      Matrox ?
  468.            0D10h      Matrox Impression Plus
  469.  102Ch     00B8h      Chips&Tech CT64310
  470.            00D8h      Chips&Tech CT65545
  471.  105Dh     2309h      Number Nine (#9) Imagine-128
  472.  1060h                UMC
  473.  1142h     3210h      Alliance Pro Motion 3210
  474.  1A08h     0000h      Sierra 15064 ?
  475.  5333h     8811h      S3 Trio64
  476.            8880h      S3 86c866
  477.            88B0h      S3 86c928P
  478.            88C0h      S3 86c864
  479.            88C1h      S3 86c864P
  480.            88D0h      S3 86c964
  481.  EDD8h     A091h      ARK 1000PV
  482.            A099h      ARK 2000PV
  483.